home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Development
/
General
/
Menu Events 1.1.2
/
Menu Events Help
/
Menu Events Help.rsrc
/
STR#_1027.txt
< prev
next >
Wrap
Text File
|
1994-04-20
|
7KB
|
267 lines
recorded.
selection, it does not cause a Select Menu Item script command to be
NOTE: While receiving a Select Menu Item event does simulate a menu
recorded, but should work as usual.
selections, try again with the Caps Lock key up. The command will not be
If an application seems to be misinterpreting or not receiving menu
release the Caps Lock key, to suppress the self-sending behavior.
duplication, you can use the item’s Command-key equivalent (if any), or
two commands when you select an item from its menus. To prevent this
If the application is scriptable in its own right, a script editor may record
processed in the usual way.
has happened. If it fails to send this event, the menu selection will be
event as a script command. A gentle “twang” sound confirms that this
modifier keys which were pressed), so that a script editor can record the
self-addressed Select Menu Item event (including parameters for any
Menu Events will try to nullify the menu selection and replace it with a
if the Caps Lock key is down at the time you release the mouse button.
where Menu Events is installed, menu item selection behavior is modified
When you are using a high-level-event-aware application on a machine
xSelf-Sending Behavior
to do program linking unless Menu Events is locked.
remote program linking. In particular, guest users should not be allowed
should be careful about which users and applications are enabled for
IMPORTANT NOTE: Users of machines where Menu Events is installed
Events at startup shows whether or not the lock is in effect.
remote sender to require user interaction. The icon displayed by Menu
because most will assume the default interaction state, not expecting any
necessary for Menu Events to be useful with most target applications,
that events sent from a remote machine are not rejected. This trick is
the default value, it will momentarily change it to kAEInteractWithAll, so
it sees that the user interaction state is kAEInteractWithLocal, which is
processes can be controlled by remote senders. If it is not locked, and if
only target applications which explicitly allow interaction with all
If the Menu Events extension is locked, using Finder’s Get Info dialog, then
application).
Users & Groups (permission to user), and Finder’s Sharing (permission to
usual program linking checks apply, namely, Sharing Setup (on/off),
If the sending and receiving applications are on different machines, the
the event.
other process, the Menu event handler will respect that state, and refuse
kAEInteractWithSelf, where it disallows interaction requested by any
If the target application is in that rare user interaction state,
target application before sending it a Menu event.
time. Another approach would be to call SetFrontProcess to activate the
Menu event, if there is any chance that it will be in the background at the
user interaction, it should call AEInteractWithUser before sending the
posted anyway. Since your sending program is indirectly instigating a
the kAECanSwitchLayer flag has no effect, and the notification request is
If both the sending program and target application are in the background,
wait state, disrupting its usual background event processing behavior.
receives a Menu event with this flag not set, it may go into a notification
notification request. If the target application is in the background, and
target application to come to the front without having to post a
interaction. It should also set the kAECanSwitchLayer flag, allowing the
flag in the sendMode parameter to AESend, in order to achieve user
The sending program must set the kAECanInteract or kAEAlwaysInteract
when it sees a mouse-down event.
target application to the front, where an application always expects to be
if it did, it would still have to request user interaction just to bring the
know which menu selections will really require user interaction, but even
joint sender/receiver control over user interaction. Menu Events doesn’t
The Apple Event Manager implements a complicated but sensible model for
xUser Interaction Policy
unknown Apple event, as it should.)
a problem if it returned errAEEventNotHandled when faced with an
classes, preventing Menu Events from working. (The handler wouldn’t be
applications, for example, bind their own handler over all Apple event
rather than some handler supplied by the application. Many Microsoft
includes a null “tattoo” parameter to prove that it handled the event,
NOTE: When replying to any of the three event types, Menu Events
there, it is exactly as though the user had actually made the selection.
given item in response. The patches then remove themselves. From
asks which menu item was selected, and the patched traps provide the
the menu bar, with modifier keys if specified. The application habitually
Fourth, if everything is OK, it posts an event to simulate a mouse click in
Menu event is still pending, it returns menuEventPendingErr.
If it finds that the patches are already in place, meaning that an earlier
Third, it patches some traps so that it can gain control of menu selection.
errAENoUserInteraction.
happens in normal operation. If it is refused, it returns
menu selection while it is in the background, something which never
interaction, because it could be dangerous to feed the target application a
Second, it asks for the application to be brought to the front for user
fashion.
assumes that the count and enable/disable flags are set in the normal
counting or disabling items may differ from the norm. Menu Events
the menu has a non-standard menu definition procedure, its way of
returns noSuchMenuErr, noSuchMenuItemErr, or menuItemDisabledErr. If
First, it verifies that the given menu item is valid and enabled. If not, it
event handling is more complex.
When you send a Select Menu Item event, the same things happen, but the
background or in the foreground, wherever it was before.
returns noSuchMenuErr. Through all of this, the application stays in the
the case of a Query Menu event, if the given menu ID is not valid, it
reply to the query on the basis of the application’s menu list structure. If
without looking at it. The event handler provided by Menu Events forms a
application will dispatch the resulting high-level event as an Apple event
When you send a Query Menu List or Query Menu event, the ideal
åHow Does Menu Events Work?
‹
‹